<template>
	<Nav :navList="navList" />
	<div class="main-layout">
		<a-form name="tt" v-model="formData" :label-col="{ span: 4 }" :wrapper-col="{ span: 18 }">
			<a-form-item label="原来密码" :name="OldPwd">
				<a-input-password v-model:value="formData.OldPwd" />
			</a-form-item>
			<a-form-item label="新密码" :name="NewPwd">
				<a-input-password v-model:value="formData.NewPwd" />
			</a-form-item>
			<a-form-item label="重复新密码" :name="NewPwd1">
				<a-input-password v-model:value="formData.NewPwd1" />
			</a-form-item>
			<a-form-item :wrapper-col="{ span: 14, offset: 4 }">
				<a-button type="primary" html-type="submit" @click="submit"> 提 交</a-button>
				<a-button style="margin-left: 10px" @click="resetForm"> 取 消 </a-button>
			</a-form-item>
		</a-form>
	</div>
</template>

<script>
export default {
	components: {},
	data() {
		return {
			formData: {},
			navList: [
				{ to: '/', name: '首页' },
				{ to: '/', name: '个人中心' },
				{ to: '', name: '修改密码' },
			],
		};
	},
	methods: {
		submit() {
			var that = this;
			/** 需要调整为post模式传参数 */
			var obj = { OldPwd: that.formData.OldPwd, NewPwd: that.formData.NewPwd };
			that.$http.post('/manage/SystemUser/UpdateUserPwd', obj, that, function (ret) {
				if (ret.Data == true) {
					that.$Message['success']({ background: true, duration: 1, content: ret.Msg });
				} else {
					that.$Message['error']({ background: true, duration: 1, content: ret.Msg });
				}
			});
		},
	},
};
</script>

<style scoped>
.main-layout {
	border: 1px solid #f0f0f0;
	padding: 20px;
	width: 600px;
}
</style>
